import org.junit.Test;

public class mytest {

    @Test
    public void test(){
        int[] tasks = {1,7,5,2,8};
        for(int i=0;i<tasks.length;i++){
            for (int j = i; j < tasks.length - i - 1; j++) {
                if(tasks[j] > tasks[j+1]){
                    int temp = tasks[j];
                    tasks[j] = tasks[j+1];
                    tasks[j+1] = temp;
                }
            }
        }
        for (int i = 0; i < tasks.length; i++) {
            System.out.println(tasks[i]);
        }
    }
}
